using System;
using BITS.PreCompiler.CSharp.Syntax;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace BITS.PreCompiler.CSharp.Tests.Syntax
{
    [TestClass]
    public class TestClassAttributes
    {
        [TestMethod]
        public void Create_CompilerIgnorTypeAttribute()
        {
            var @class = new Class("MyClass")
            {
                new CompilerIgnorTypeAttributeDeclaration(),
            };

            var expectet = Comparer.Create_CompilerIgnorTypeAttribute();
            var actual = @class.ToString();

            Assert.AreEqual(expectet, actual);
            Console.WriteLine(actual);
        }

        [TestMethod]
        public void Create_CompilerIgnorTypeAttribute_With_Namespace()
        {
            var @namespace = new Namespace("Test")
            {
                new Class("MyClass")
                {
                    new CompilerIgnorTypeAttributeDeclaration(),
                }
            };

            var expectet = Comparer.Create_CompilerIgnorTypeAttribute_With_Namespace();
            var actual = @namespace.ToString();

            Assert.AreEqual(expectet, actual);
            Console.WriteLine(actual);
        }

        public static class Comparer
        {
            public static String Create_CompilerIgnorTypeAttribute()
            {
                return
@"[CompilerIgnorTypeAttribute]
public class MyClass
{
}";
            }

            public static String Create_CompilerIgnorTypeAttribute_With_Namespace()
            {
                return
@"namespace Test
{
    [CompilerIgnorTypeAttribute]
    public class MyClass
    {
    }
}";
            }
        }
    }
}